inherited frmAbonentTraitSet: TfrmAbonentTraitSet
  Left = 427
  Top = 154
  VertScrollBar.Range = 0
  BorderStyle = bsDialog
  Caption = #1048#1079#1084#1077#1085#1077#1085#1080#1077'/'#1044#1086#1073#1072#1074#1083#1077#1085#1080#1077' '#1087#1088#1080#1079#1085#1072#1082#1072' '#1072#1073#1086#1085#1077#1085#1090#1072
  ClientHeight = 249
  ClientWidth = 354
  OldCreateOrder = True
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel [0]
    Left = 36
    Top = 19
    Width = 44
    Height = 13
    Alignment = taRightJustify
    AutoSize = False
    Caption = #1055#1088#1080#1079#1085#1072#1082
  end
  object Label2: TLabel [1]
    Left = 17
    Top = 43
    Width = 63
    Height = 13
    Alignment = taRightJustify
    AutoSize = False
    Caption = #1044#1077#1081#1089#1090#1074#1091#1077#1090' '#1089
  end
  object Label3: TLabel [2]
    Left = 17
    Top = 67
    Width = 63
    Height = 13
    Alignment = taRightJustify
    AutoSize = False
    Caption = #1087#1086
  end
  object Label4: TLabel [3]
    Left = 17
    Top = 91
    Width = 63
    Height = 13
    Alignment = taRightJustify
    AutoSize = False
    Caption = #1047#1085#1072#1095#1077#1085#1080#1077
  end
  inherited Panel1: TPanel
    Top = 222
    Width = 354
    inherited BitBtn1: TBitBtn
      Left = 147
    end
    inherited BitBtn2: TBitBtn
      Left = 249
    end
  end
  inherited ToolBar1: TToolBar
    Width = 354
    Height = 0
    Visible = False
  end
  object lcbTraitName: TDBLookupComboboxEh [6]
    Left = 88
    Top = 16
    Width = 257
    Height = 19
    AlwaysShowBorder = True
    Color = clInactiveCaptionText
    DataField = 'TRAITS_ID'
    DataSource = dscTrait
    DropDownBox.Sizable = True
    EditButtons = <>
    Flat = True
    KeyField = 'ID'
    ListField = 'NAME'
    ListSource = dscTraitList
    ReadOnly = True
    TabOrder = 2
    Visible = True
  end
  object dbtBdate: TDBDateTimeEditEh [7]
    Left = 88
    Top = 40
    Width = 121
    Height = 19
    AlwaysShowBorder = True
    DataField = 'BDATE'
    DataSource = dscTrait
    EditButtons = <>
    Flat = True
    Kind = dtkDateEh
    TabOrder = 3
    Visible = True
  end
  object dbtEdate: TDBDateTimeEditEh [8]
    Left = 88
    Top = 64
    Width = 121
    Height = 19
    AlwaysShowBorder = True
    DataField = 'EDATE'
    DataSource = dscTrait
    EditButtons = <>
    Flat = True
    Kind = dtkDateEh
    TabOrder = 4
    Visible = True
  end
  object dbeValue: TDBEditEh [9]
    Left = 88
    Top = 88
    Width = 257
    Height = 121
    AlwaysShowBorder = True
    AutoSize = False
    DataField = 'TRAITS_VALUE'
    DataSource = dscTrait
    EditButtons = <>
    Flat = True
    TabOrder = 5
    Visible = True
    WordWrap = True
  end
  object lcbValueId: TDBLookupComboboxEh [10]
    Left = 88
    Top = 88
    Width = 257
    Height = 19
    AlwaysShowBorder = True
    DataField = 'TRAITS_VALUE_ID'
    DataSource = dscTrait
    DropDownBox.Sizable = True
    EditButtons = <>
    Flat = True
    KeyField = 'ID'
    ListField = 'NAME'
    ListSource = dscTraitValues
    TabOrder = 6
    Visible = True
  end
  inherited ActionList1: TActionList
    Left = 64
    Top = 65524
    inherited aSave: TAction
      OnExecute = aSaveExecute
    end
    inherited aCancel: TAction
      OnExecute = aCancelExecute
    end
  end
  inherited PropStorage: TPropStorageEh
    Active = False
    Left = 24
    Top = 65524
  end
  object dsTrait: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE ABONENTS2TRAITS'
      'SET '
      '    TRAITS_VALUE_ID = :TRAITS_VALUE_ID,'
      '    TRAITS_VALUE = :TRAITS_VALUE,'
      '    BDATE = :BDATE,'
      '    EDATE = :EDATE'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      ''
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO ABONENTS2TRAITS('
      '    ABONENT_ID,'
      '    TRAITS_ID,'
      '    TRAITS_VALUE_ID,'
      '    TRAITS_VALUE,'
      '    BDATE,'
      '    EDATE'
      ')'
      'VALUES('
      '    :ABONENT_ID,'
      '    :TRAITS_ID,'
      '    :TRAITS_VALUE_ID,'
      '    :TRAITS_VALUE,'
      '    :BDATE,'
      '    :EDATE'
      ')'
      'returning ID')
    RefreshSQL.Strings = (
      'SELECT first(1)'
      '    ID,'
      '    ABONENT_ID,'
      '    TRAITS_ID,'
      '    TRAITS_VALUE_ID,'
      '    TRAITS_VALUE,'
      '    BDATE,'
      '    EDATE,'
      '    VIEW_VALUE'
      'FROM'
      '    ABONENTS2TRAITS '
      'where ID = :pabonent2trait_id'
      '    ')
    SelectSQL.Strings = (
      'SELECT first(1)'
      '    ID,'
      '    ABONENT_ID,'
      '    TRAITS_ID,'
      '    TRAITS_VALUE_ID,'
      '    TRAITS_VALUE,'
      '    BDATE,'
      '    EDATE,'
      '    VIEW_VALUE'
      'FROM'
      '    ABONENTS2TRAITS '
      'where ID = :pabonent2trait_id')
    Transaction = trLocal
    Database = MAINDM.pMainDatabase
    Left = 240
    Top = 32
    object dsTraitID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTraitABONENT_ID: TFIBIntegerField
      FieldName = 'ABONENT_ID'
    end
    object dsTraitTRAITS_ID: TFIBIntegerField
      FieldName = 'TRAITS_ID'
    end
    object dsTraitTRAITS_VALUE_ID: TFIBIntegerField
      FieldName = 'TRAITS_VALUE_ID'
    end
    object dsTraitTRAITS_VALUE: TFIBStringField
      FieldName = 'TRAITS_VALUE'
      Size = 255
      EmptyStrToNull = True
    end
    object dsTraitBDATE: TFIBDateField
      FieldName = 'BDATE'
    end
    object dsTraitEDATE: TFIBDateField
      FieldName = 'EDATE'
    end
    object dsTraitVIEW_VALUE: TFIBStringField
      FieldName = 'VIEW_VALUE'
      Size = 255
      EmptyStrToNull = True
    end
  end
  object trLocal: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 304
    Top = 32
  end
  object dscTrait: TDataSource
    DataSet = dsTrait
    Left = 272
    Top = 32
  end
  object dsTraitValues: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME'
      'FROM'
      '    ABONENT_TRAITS_VALUES '
      'where TRAIT_ID = :ID'
      'order by name')
    Transaction = trList
    Database = MAINDM.pMainDatabase
    DataSource = dscTraitList
    Left = 240
    Top = 64
    WaitEndMasterScroll = True
    dcForceOpen = True
    object dsTraitValuesID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTraitValuesNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dscTraitValues: TDataSource
    DataSet = dsTraitValues
    Left = 272
    Top = 64
  end
  object trList: TpFIBTransaction
    DefaultDatabase = MAINDM.pMainDatabase
    TimeoutAction = TARollback
    Left = 304
    Top = 64
  end
  object dsTraitList: TpFIBDataSet
    SelectSQL.Strings = (
      'SELECT'
      '    ID,'
      '    NAME,'
      '    CODE,'
      
        '    iif(exists(select 1 from abonent_traits_values aa where aa.t' +
        'rait_id = ar.id), 1, 0) as list_trait  '
      'FROM'
      '    ABONENT_TRAITS ar'
      'where id = :trait_id or :trait_id = 0')
    AfterOpen = dsTraitListAfterOpen
    Transaction = trList
    Database = MAINDM.pMainDatabase
    Left = 240
    Top = 96
    object dsTraitListID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTraitListNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsTraitListCODE: TFIBStringField
      FieldName = 'CODE'
      Size = 16
      EmptyStrToNull = True
    end
    object dsTraitListLIST_TRAIT: TFIBIntegerField
      FieldName = 'LIST_TRAIT'
    end
  end
  object dscTraitList: TDataSource
    DataSet = dsTraitList
    Left = 272
    Top = 96
  end
end
